﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Job.Web.Framework;

namespace Job.Web.Person
{
    public partial class PersonalResume : BasePage
    {
        int rsubjectId = myR["subjectid"].IntValue;
        int resumeId = myR["resumeid"].IntValue;

        protected void Page_Load(object sender, EventArgs e)
        {
            MySession session = new MySession();
            if (session.GetPersonalFromSession() == null)
            {
                string url = WebCommon.GetApplicationPath(Request) + "Person/PersonLogin.aspx?categoryid=1";
                Response.Redirect(url);
            }

            this.LoadControls();
        }

        private void LoadControls()
        {
            string fileName = "~/userControls/Personal/PersonalBaseInfo.ascx";
            switch (rsubjectId)
            {
                case (int)Constants.ResumeSubject.BaseInfo:
                    fileName = "~/userControls/Personal/PersonalBaseInfo.ascx";
                    break;
                case (int)Constants.ResumeSubject.Education:
                    fileName = "~/userControls/Personal/Education.ascx";
                    break;
                case (int)Constants.ResumeSubject.OtherDesc:
                case (int)Constants.ResumeSubject.PersonDesc:
                case (int)Constants.ResumeSubject.ForeignResume:
                    fileName = "~/userControls/Personal/PersonClob.ascx";
                    break;
                case (int)Constants.ResumeSubject.CareerObjective:
                    fileName = "~/userControls/Personal/CareerObjective.ascx";
                    break;
                case (int)Constants.ResumeSubject.Language:
                    fileName = "~/userControls/Personal/LanguageSkills.ascx";
                    break;
                case (int)Constants.ResumeSubject.Train:
                    fileName = "~/userControls/Personal/TrainList.ascx";
                    break;
                case (int)Constants.ResumeSubject.WorkExperience:
                    fileName = "~/userControls/Personal/WorkExperience.ascx";
                    break;
                case (int)Constants.ResumeSubject.UploadPhoto:
                    fileName = "~/userControls/Personal/UploadPhoto.ascx";
                    break;
                case (int)Constants.ResumeSubject.Certification:
                    fileName = "~/userControls/Personal/Certifys.ascx";
                    break;

                case (int)Constants.ResumeSubject.AdvanceHR:
                    fileName = "~/userControls/Personal/AdvanceHR.ascx";
                    break;

                case (int)Constants.ResumeSubject.ProjectExperience:
                    fileName = "~/userControls/Personal/ProjectExperience.ascx";
                    break;

                case (int)Constants.ResumeSubject.ITSkill:
                    fileName = "~/userControls/Personal/Skills.ascx";
                    break;
            }

            this.LoadCtrl(fileName, "phResume");
        }
    }
}
